<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Update Course Information</title>
</head>
<style>
  html {
        overflow: scroll; 
      }
.scrollable{
   overflow: auto;
   width: 70px; /* adjust this width depending to amount of text to display */
   height: 80px; /* adjust height depending on number of options to display */
   border: 1px silver solid;
 }
body{background-image:url('Images/sjsu logo.jpg');
background-repeat: no-repeat;
  background position: top center;
  background-size: 100%;
  background-size: 1400px 1200px;
  position:relative;}
  
h3.pos_fixed{
color:#6D63A9;
position:relative;
top:25px;
left:30px;
}
#b{
position:relative;
top:140px;
left:320px;
}

a:link    {
  /* Applies to all unvisited links */
  text-decoration:  none;
  font-weight:      bold;
  color:          "#blue";
  font-size:120%;
  } 

</style>
<div id="b">
	<div id="c"><font size="4" color=#4B5992><b>Update Course Information</b></font></div><br><br>

<!--  <h1>Update Course Information</h1>-->
</head>
<body>

<form action="UpdateCourse.php" method="GET">
<div id="e"><font size="4" color=#4B5992>Course Number: <input type='text' name = 'cnumber' /> <br/>

<div id="g"><font size="4" color=#4B5992><input type='submit' name = 'search' value='Search'/>

</form>
</body>

</html>

<?php
session_start();
if(isset($_SESSION["shwetha_result"])) {
	echo $_SESSION["shwetha_result"];
	unset($_SESSION["shwetha_result"]);
}
	if(!isset($_GET["cnumber"])) {
		return;
	}
	require "config.php";
	$cnumber = $_GET['cnumber'];
	
	$con = mysql_connect("localhost",$db_user ,$db_pass);
	// if an error was encountered, the script exits with an error message
	if (!$con){
		die('Could not connect: ' . mysql_error());
    }
	//after successfully connecting with the database server, select the database with which you want to communicate
	mysql_select_db($db_name, $con);
	
	
	$query1 = sprintf("SELECT * FROM course WHERE (courseNumber = \"%s\")",$cnumber);
	//echo $query1."<br/>";
	$result1 = mysql_query($query1);
	$numbr_rows=mysql_num_rows($result1);
	mysql_close($con);
	if($numbr_rows==0){?>
     <br><?php echo "Incorrect course number.Please check";?><br><?php 
		
     }else {
     $coursenumber = $cnumber;
     require_once 'UpdateCourseInfo.php';
	}
	

?>
<html>

<br><div id="i"><font size="4" color=#4B5992><br><a href="MainMenu.php">Home</a><br>

</html>